﻿using GameFramework.Battle.Core;
using Gameplay.PVE;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;

public class PveTouchPanel : Button, IDragHandler, IBeginDragHandler, IEndDragHandler
{
    private Vector2 startPosition;
    private int delayID;
    public void OnBeginDrag(PointerEventData eventData)
    {
        if (delayID > 0)
        {
            TimeManager.Instance.CancelDelayCall(delayID);
        }
        //PveCameraManager.Instance.StartRpgDragNew();
        startPosition = eventData.position;
    }
    
    public void OnDrag(PointerEventData eventData)
    {
        var dragOffset = eventData.position - startPosition;
        //PveCameraManager.Instance.SetCmaeraPosition(dragOffset * 0.08f);
        startPosition = eventData.position;
    }
    
    public void OnEndDrag(PointerEventData eventData)
    {
        TimeManager tm = TimeManager.Instance;
        //delayID = tm.DelayCall(250, () => { PveCameraManager.Instance.EndRpgDragNew(); });
    }
}